// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package com.nnee.p_pr.p_activity;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.widget.LinearLayout;
import com.nnee.p_b.p_b.p_a.cls_b;
import com.nnee.p_b.p_b.p_f.cls_a;
import com.nnee.p_b.p_b.p_g.cls_c;
import com.nnee.p_b.p_b.p_h.cls_d;
import com.nnee.p_fk.cls_ActivityEx;
import com.nnee.p_pr.p_a.cls_h;

// Referenced classes of package com.nnee.p_pr.p_activity:
//            ck, cz

public class cls_MBlogBindActivity extends cls_ActivityEx
{

    public cls_MBlogBindActivity()
    {
        j = false;
        k = false;
        m = new cls_ck(this);
    }

    static com.nnee.p_b.p_b.p_e.cls_c a(cls_MBlogBindActivity mblogbindactivity)
    {
        return mblogbindactivity.i;
    }

    static com.nnee.p_b.p_b.p_e.cls_c a(cls_MBlogBindActivity mblogbindactivity, com.nnee.p_b.p_b.p_e.cls_c c1)
    {
    	mblogbindactivity.i = c1;
        return c1;
    }

    public static String a(String s)
    {
        StringBuilder stringbuilder = new StringBuilder();
        stringbuilder.append("<h1><center>");
        stringbuilder.append(s);
        stringbuilder.append("<h1><center>");
        return stringbuilder.toString();
    }

    public static void a(Context context, int i1)
    {
        Intent intent = new Intent(context, com.nnee.p_pr.p_activity.cls_MBlogBindActivity.class);
        intent.putExtra("bind_type", i1);
        intent.setFlags(0x10000000);
        context.startActivity(intent);
    }

    static void a(cls_MBlogBindActivity mblogbindactivity, String s)
    {
         mblogbindactivity.c(s);
    }

    static void a(cls_MBlogBindActivity mblogbindactivity, boolean flag, boolean flag1)
    {
         mblogbindactivity.a(flag, flag1);
    }

    private void a(boolean flag, boolean flag1)
    {
        LinearLayout linearlayout = g;
        int i1;
        if(flag)
            i1 = 0;
        else
            i1 = 8;
        linearlayout.setVisibility(i1);
        if(flag1)
        {
            h.setVisibility(0);
            h.requestFocus();
        } else
        {
            h.setVisibility(8);
        }
    }

    static boolean a(cls_MBlogBindActivity mblogbindactivity, boolean flag)
    {
         mblogbindactivity.j = flag;
        return flag;
    }

    static int b(cls_MBlogBindActivity mblogbindactivity)
    {
        return  mblogbindactivity.f;
    }

    private String b(Context context, int i1)
    {
        int j1 = 0;
       switch( i1)
       {
       case 1:
    	   j1 = 0x7f0a011d;
    	   break;
       case 2:
    	   j1 = 0x7f0a011f;
    	   break;
       case 3:
    	   j1 = 0x7f0a011e;
    	   break;
       case 4:
    	   j1 = 0x7f0a0122;
    	   break;
       case 5:
    	   j1 = 0x7f0a0121;
    	   break;
       case 6:
    	   j1 = 0x7f0a0120;
    	   break;
       case 7:
    	   j1 = 0x7f0a0123;
    	   break;
       default:
    	   break;
    	   
       }
       
       return context.getString(j1);
        
    }

    private void b()
    {
        if(f != 1) {
        	if(f == 3){
                //l = com.nnee.p_b.p_b.p_g.cls_c.a().a(m);
        	}
            else
            if(f == 4)
                l = com.nnee.p_b.p_b.p_b.cls_a.a().a(m);
            else
            if(f == 2)
            {
               // l = com.nnee.p_b.p_b.p_d.cls_c.a().a(m);
            }
            else
            if(f == 5)
                l = com.nnee.p_b.p_b.p_a.cls_b.a().a(m);
            else
            if(f == 6)
                l = com.nnee.p_b.p_b.p_c.cls_a.a().a(m);
            else
            if(f == 7)
                l = com.nnee.p_b.p_b.p_h.cls_d.a().a(m);
        } else {
        	l = com.nnee.p_b.p_b.p_f.cls_a.a().a(m);
        }
 
    }

    static WebView c(cls_MBlogBindActivity mblogbindactivity)
    {
        return  mblogbindactivity.h;
    }

    private void c()
    {
        if(f != 1) {
        	 if(f == 3){
                 //com.nnee.p_b.p_b.p_g.cls_c.a().a(l);
        	 }
             else
             if(f == 4)
                 com.nnee.p_b.p_b.p_b.cls_a.a().a(l);
             else
             if(f == 2){
                // com.nnee.p_b.p_b.p_d.cls_c.a().a(l);
             }
             else
             if(f == 5)
                 com.nnee.p_b.p_b.p_a.cls_b.a().a(l);
             else
             if(f == 6)
                 com.nnee.p_b.p_b.p_c.cls_a.a().a(l);
             else
             if(f == 7)
                 com.nnee.p_b.p_b.p_h.cls_d.a().a(l);
        } else {
        	com.nnee.p_b.p_b.p_f.cls_a.a().a(l);
        }
 
    }

    private void c(String s)
    { int l1 ;
    	int i1;
        String s2;
        int j1;
        int k1;
        String s3;
        String s1 = null;
        if(s == null || !s.startsWith("prisblog://oauth_callback")) {
        	if(s != null && s.startsWith("http://graph.renren.com/oauth/login_success.html"))
            {
                 l1 = s.indexOf("access_token=");
                
                if(l1 != -1)
                {
                    int i2 = l1 + "access_token=".length();
                    int j2 = s.indexOf("&", i2);
                    if(j2 != -1 && j2 > i2)
                        s3 = s.substring(i2, j2);
                    else
                        s3 = s.substring(i2);
                } else
                {
                    s3 = s1;
                }
                i.a(s3, s1);
            } else
            if(s != null && s.startsWith("http://yuedu.163.com/redirect_uri"))
            {
                i1 = s.indexOf("code=");
                if(i1 != -1)
                {
                    j1 = i1 + "code=".length();
                    k1 = s.indexOf("&", j1);
                    if(k1 != -1 && k1 > j1)
                        s2 = s.substring(j1, k1);
                    else
                        s2 = s.substring(j1);
                } else
                {
                    s2 = s1;
                }
                i.a(s1, s2);
            }
        }else {
        	String as[] = s.substring(1 + "prisblog://oauth_callback".length()).split("&");
            int k2 = 0;
            String s4 = s1;
            while(k2 < as.length) 
            {
                String s5 = as[k2];
                if(s5.startsWith("oauth_token="))
                    s1 = s5.substring(1 + "oauth_token".length());
                else
                if(s5.startsWith("oauth_verifier="))
                    s4 = s5.substring(1 + "oauth_verifier".length());
                k2++;
            }
            i.a(s1, s4);
        }
    }

    protected void onCreate(Bundle bundle)
    {
        super.onCreate(bundle);
        Intent intent = getIntent();
        if(intent == null)
        {
            finish();
        } else
        {
            f = intent.getIntExtra("bind_type", 0);
            if(f == 0)
            {
                com.nnee.p_pr.p_a.cls_h.a(this, 0x7f0a00fa);
                finish();
            } else
            {
                Object aobj[] = new Object[1];
                aobj[0] = b(this, f);
                setTitle(getString(0x7f0a00f9, aobj));
                setContentView(0x7f030010);
                g = (LinearLayout)findViewById(0x7f0d002f);
                h = (WebView)findViewById(0x7f0d002e);
                h.setVerticalScrollBarEnabled(false);
                h.setHorizontalScrollBarEnabled(false);
                h.setWebViewClient(new cls_cz(this, null));
                h.getSettings().setJavaScriptEnabled(true);
                a(true, false);
                b();
            }
        }
    }

    protected void onDestroy()
    {
        c();
        super.onDestroy();
    }

    protected void onNewIntent(Intent intent)
    {
        com.nnee.p_g.cls_b.c("MBlogBindActivity", (new StringBuilder()).append("onNewIntent:").append(j).toString());
        super.onNewIntent(intent);
        if(j)
        {
            c(intent.getData().toString().toString());
            k = true;
        } else
        {
            finish();
        }
    }

    protected void onResume()
    {
        com.nnee.p_g.cls_b.c("MBlogBindActivity", (new StringBuilder()).append("onResume:").append(j).toString());
        super.onResume();
        if(j && !k)
            finish();
    }

    public static final String a = "prisblog://oauth_callback";
    public static final String b = "http://graph.renren.com/oauth/login_success.html";
    public static final String c = "http://yuedu.163.com/redirect_uri";
    private static final String e = "bind_type";
    private final String d = "MBlogBindActivity";
    private int f;
    private LinearLayout g;
    private WebView h;
    private com.nnee.p_b.p_b.p_e.cls_c i;
    private boolean j;
    private boolean k;
    private int l;
    private com.nnee.p_b.p_b.p_e.cls_d m;
}
